<template>
  <basic-form
    ref="ruleForm"
    v-model="roleForm"
    :rules="roleRule"
    primary-key="roleId"
    :query-api="role_queryByIdApi"
    :insert-api="role_insertApi"
    :update-api="role_updateApi"
    :wrapper-col="{span:16}"
  >
    <a-form-model-item label="角色名称" prop="roleName" ref="roleName" :hasFeedback="true">
      <a-input v-model="roleForm.roleName" placeholder="请输入角色名称" />
    </a-form-model-item>

    <a-form-model-item label="角色描述" prop="roleDescription" :hasFeedback="true">
      <a-input v-model="roleForm.roleDescription" type="textarea" placeholder="角色描述......" />
    </a-form-model-item>
    <a-form-model-item label="能否更新" prop="isUpdate">
      <a-radio-group v-model="roleForm.isUpdate">
        <a-radio :value="true">可以</a-radio>
        <a-radio :value="false">不能</a-radio>
      </a-radio-group>
    </a-form-model-item>
  </basic-form>
</template>
<script>
import {
  role_queryByIdApi,
  role_insertApi,
  role_updateApi
} from "@/api/org/role";
import { roleRule } from "@/profile/org/role";
export default {
  props: {
    roleId: {
      //角色id
      type: String
    }
  },
  data() {
    return {
      role_queryByIdApi,
      role_insertApi,
      role_updateApi,
      roleForm: {
        roleId: this.roleId
      },
      roleRule
    };
  }
};
</script>